package org.rabbitmq.logisticsservice.listener;

import org.rabbitmq.orderservice.util.OrderInfo;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@RabbitListener(queues = "order.queue")
@Component
public class OrderListener {
    //接收消息
    @RabbitHandler
    public void ListenerQueue(String msg){
        System.out.println("接收消息:"+msg);
    }

    @RabbitHandler
    public void ListenerQueue(OrderInfo orderInfo){
        System.out.println("接收消息OrderInfo:"+orderInfo);
    }
}
